Socket
Socket
Sign inDemoInstall

bpk-component-button

Package Overview
Dependencies
2
Maintainers
6
Versions
562
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bpk-component-button

Backpack button component.


Version published
Weekly downloads
323
increased by32.92%
Maintainers
6
Created
Weekly downloads
 

Readme

Source

bpk-component-button

Backpack button component.

Installation

npm install bpk-component-button --save-dev

Usage

import React from 'react';
import { withButtonAlignment, withRtlSupport } from 'bpk-component-icon';
import ArrowIcon from 'bpk-component-icon/sm/long-arrow-right';
import BpkButton from 'bpk-component-button';

const AlignedArrowIcon = withButtonAlignment(withRtlSupport(ArrowIcon));

export default () => (
  <div>
    <BpkButton>Primary</BpkButton>
    <BpkButton large>Large primary</BpkButton>
    <BpkButton secondary>Secondary</BpkButton>
    <BpkButton secondaryOnDark>SecondaryOnDark</BpkButton>
    <BpkButton link>Link</BpkButton>
    <BpkButton linkOnDark>LinkOnDark</BpkButton>
    <BpkButton outline>Outline (Deprecated, use PrimaryOnDark or PrimaryOnLight instead)</BpkButton>
    <BpkButton primaryOnDark>PrimaryOnDark</BpkButton>
    <BpkButton primaryOnLight>PrimaryOnLight</BpkButton>
    <BpkButton iconOnly>
      <AlignedArrowIcon />
      <span className="visually-hidden">Search</span>
    </BpkButton>
  </div>
);

Props

PropertyPropTypeRequiredDefault Value
children-true-
destructiveboolfalsefalse
featuredboolfalsefalse
linkboolfalsefalse
linkOnDarkboolfalsefalse
outlinebool (deprecated)falsefalse
secondaryboolfalsefalse
secondaryOnDarkboolfalsefalse
primaryOnDarkboolfalsefalse
primaryOnLightboolfalsefalse
blankboolfalsefalse
classNamestringfalsenull
disabledboolfalsefalse
hrefstringfalsenull
iconOnlyboolfalsefalse
largeboolfalsefalse
onClickfuncfalsenull
relstringfalsenull
submitboolfalsefalse

Theme Props

Primary:

  • buttonPrimaryTextColor
  • buttonPrimaryHoverTextColor
  • buttonPrimaryActiveTextColor
  • buttonPrimaryGradientStartColor
  • buttonPrimaryGradientEndColor
  • buttonPrimaryBackgroundColor
  • buttonPrimaryHoverBackgroundColor
  • buttonPrimaryActiveBackgroundColor

Primary on dark:

  • buttonPrimaryOnDarkTextColor
  • buttonPrimaryOnDarkHoverTextColor
  • buttonPrimaryOnDarkActiveTextColor
  • buttonPrimaryOnDarkBackgroundColor
  • buttonPrimaryOnDarkHoverBackgroundColor
  • buttonPrimaryOnDarkActiveBackgroundColor

Primary on light:

  • buttonPrimaryOnLightTextColor
  • buttonPrimaryOnLightHoverTextColor
  • buttonPrimaryOnLightActiveTextColor
  • buttonPrimaryOnLightBackgroundColor
  • buttonPrimaryOnLightHoverBackgroundColor
  • buttonPrimaryOnLightActiveBackgroundColor

Secondary:

  • buttonSecondaryTextColor
  • buttonSecondaryHoverTextColor
  • buttonSecondaryActiveTextColor
  • buttonSecondaryBorderColor
  • buttonSecondaryHoverBorderColor
  • buttonSecondaryActiveBorderColor
  • buttonSecondaryBackgroundColor
  • buttonSecondaryHoverBackgroundColor
  • buttonSecondaryActiveBackgroundColor

Secondary on dark:

  • buttonSecondaryOnDarkTextColor
  • buttonSecondaryOnDarkHoverTextColor
  • buttonSecondaryOnDarkActiveTextColor
  • buttonSecondaryOnDarkBackgroundColor
  • buttonSecondaryOnDarkHoverBackgroundColor
  • buttonSecondaryOnDarkActiveBackgroundColor
  • buttonFeaturedTextColor
  • buttonFeaturedHoverTextColor
  • buttonFeaturedActiveTextColor
  • buttonFeaturedGradientStartColor
  • buttonFeaturedGradientEndColor
  • buttonFeaturedBackgroundColor
  • buttonFeaturedHoverBackgroundColor
  • buttonFeaturedActiveBackgroundColor

Destructive:

  • buttonDestructiveTextColor
  • buttonDestructiveHoverTextColor
  • buttonDestructiveActiveTextColor
  • buttonDestructiveBorderColor
  • buttonDestructiveHoverBorderColor
  • buttonDestructiveActiveBorderColor
  • buttonDestructiveBackgroundColor
  • buttonDestructiveHoverBackgroundColor
  • buttonDestructiveActiveBackgroundColor

All button types:

  • buttonFontSize (Optional)

FAQs

Last updated on 02 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc